#ifndef STDAFX_H_INCLUDED
#define STDAFX_H_INCLUDED

#include <wx/string.h>
#include <wx/filefn.h>

///(* Constants
static const wxString mmSharedDBName   = "share";
static const wxString mmImageDir       = wxGetCwd() + "\\media\\images\\";
static const wxString mmSoundDir       = wxGetCwd() + "\\media\\sounds\\";
static const wxString mmErrLogFileName = wxGetCwd() + "\\log\\ErrorLog.log";
#ifdef _DEBUG
 static const wxString mmProgName      = "MyMoney - Debug version";
 static const wxString mmIniFile       = wxGetCwd() + "\\data\\debug\\MyMoneyd.ini";
 static const wxString mmPluginDir     = wxGetCwd() + "\\plugins\\debug\\";
 static const wxString mmPluginExt     = "*d.dll";
 static const wxString mmOptionsFile   = wxGetCwd() + "\\Data\\Debug\\Optionsd.mmf";
#else
 static const wxString mmProgName      = "MyMoney";
 static const wxString mmIniFile       = wxGetCwd() + "\\data\\MyMoney.ini";
 static const wxString mmPluginDir     = wxGetCwd() + "\\plugins\\";
 static const wxString mmPluginExt     = "*.dll";
 static const wxString mmOptionsFile   = wxGetCwd() + "\\Data\\Options.mmf";
#endif
static const char*    mmSqlGroups[]    = { "server", "embedded", "MyMoney_SERVER", NULL };

static const wxString mmOPEN           = "Open";
static const wxString mmCLEARED        = "Cleared";
static const wxString mmRECONCILED     = "Reconciled";

static const wxString mmSTART          = "Start";
static const wxString mmDEPOSIT        = "Deposit";
static const wxString mmTRANSFER       = "Transfer";
static const wxString mmATM            = "ATM";
static const wxString mmDEBIT          = "Debit";
static const wxString mmCHECK          = "Check";

static const int mmDBNameLength        = 16;
///*)

///(* Enumerated types
enum TRANSACTIONTYPE
{
    TT_NONE         = 9050,
    TT_START,
    TT_DEPOSIT,
    TT_TRANSFER,
    TT_ATM,
    TT_DEBIT,
    TT_CHECK
};

enum TRANSACTIONSTATUS
{
    TS_OPEN         = 9075,
    TS_CLEARED,
    TS_RECONCILED
};

enum REOCCURINGLISTTYPE
{
    RT_DEBIT        = 9100,
    RT_DEPOSIT,
    RT_TRANSFER
};

enum OCCURANCE
{
    BO_NONE         = 9125,
    BO_ONCE,
    BO_DAILY,
    BO_WEEKLY,
    BO_BIWEEKLY,
    BO_TWICEMONTHLY,
    BO_MONTHLY,
    BO_QUARTERLY,
    BO_TWICEANNUALLY,
    BO_ANNUALLY
};

enum SEARCHTYPE
{
    ST_DATE         = 9150,
    ST_DATERANGE,
    ST_CHECK,
    ST_CHECKRANGE,
    ST_TRANSACTIONTYPE,
    ST_PAYEE,
    ST_CATEGORY
};

enum LANGUAGES
{
    LA_ENGLISH      = 0,
};
///*)

///(* Data structures
struct SColumn
{
    int       Number;
    wxString  Header;
    wxString  MySQLName;
    int       Width;
    int       Align;       /* -1 = left, 0 = center, 1 = right */
    SColumn() : Number(0), Header(""), MySQLName(""), Width(0), Align(0) {}
};

struct SUserInfo
{
    wxString               FirstName;
    wxString               LastName;
    wxString               UserName;
    wxString               Password;
    wxString               DefaultDBName;
};

/* TODO (Developer 1#1#): Add another field for "Time".  This will only affect sort by operations
when querying the database for transactions to display, creating a
more stable sorting. Will need to ass appropriate code to
"CAccount::CreateTransactionTable()" as well as any query operations
thatask for transaction data. */
struct STransaction
{
    size_t                 TransactionNumber;
    size_t                 TransferNumber;
    wxString               AccountName;
    size_t                 TransferAccountID;
    wxString               Date;
    wxString               Time;
    wxString               Type;
    size_t                 CheckNumber;
    wxString               Payee;
    double                 Amount;
    wxString               Category;
    wxString               SubCategory;
    wxString               Comment;
    wxString               Status;
    bool                   IsDeposit;
    STransaction()
      : TransactionNumber(0), TransferNumber(0), AccountName(""), TransferAccountID(0),
        Date(""), Time(""), Type(""), CheckNumber(0), Payee(""), Amount(0.00), Category(""),
        SubCategory(""), Comment(""), Status(mmOPEN), IsDeposit(true) {}
};

struct SAccountInfo
{
    size_t        ID;
    wxString      AccountName;
    wxString      AccountNumber;
    wxString      AccountType;
    wxString      BankName;
    wxString      BankAddress;
    wxString      BankPhone;
    double        CurrentBalance;
    wxString      DateOpened;
    double        OpeningBalance;
    wxString      LastStatementDate;
    double        LastStatementBalance;
    wxString      AccountFileName;
};

struct SReoccuringTransaction
{
    size_t              Number;
    wxString            Name;
    size_t              Type;
    size_t              Frequency;
    wxString            NextOccurance;
    wxString            LastOccurance;
    double              EstAmount;
    double              LastAmount;
    size_t              TransactionType;
    wxString            PayFromAccountName;
    wxString            DepositToAccountName;
    wxString            Category;
    wxString            SubCategory;
};

struct SBalanceInfo
{
    wxString    EndDate;
    wxString    EndBalance;
    wxString    ServiceCharge;
    wxString    InterestPaid;
    bool        IsServiceCharge;
    bool        IsInterestPaid;
};

struct SSearchCriteria
{
    SEARCHTYPE  SearchType;
    wxString    SearchStringOne;
    wxString    SearchStringTwo;
};
///*)

#endif // STDAFX_H_INCLUDED
